import Vue from 'vue'
import VueRouter from 'vue-router'
import Detail from 'views/detail/Detail'

Vue.use(VueRouter)

const router = new VueRouter({
    mode:'history',
    routes:[
        {
            path:'',
            redirect:'/home'
        },
        {
            path:'/home',
            component:()=>import('views/home/Home')
        },
        {
            path:'/category',
            component:()=>import('views/category/Category')
        },
        {
            path:'/cart',
            component:()=>import('views/cart/Cart')
        },
        {
            path:'/profile',
            component:()=>import('views/profile/Profile')
        },
        {
            path:'/detail/:iid',
            // component:()=>import('views/detail/Detail')
            component:Detail
        }
    ]
})

export default router
